package com.music.dao;

import com.laoxuai.beans.annotation.Component;
import com.laoxuai.ibatis.support.BaseDao;
import com.music.pojo.Record;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.SQLException;

@Component
public class RecordDao extends BaseDao<Record, Integer> {

    public Record getRecord(Integer userId, Integer musicId) throws SQLException {
        return runner.query("select *from t_record where user_id=? and music_id=?",new BeanHandler<>(Record.class),userId,musicId);
    }
}
